Skip to content

Adding newly shared SVML Float16 HA imlementation - #9

Merged
r-devulap merged 3 commits into
numpy:mainfrom
r-devulap:fp16-ha
Sep 11, 2026
Merged

r-devulap merged 3 commits into
numpy:mainfrom
r-devulap:fp16-ha

Conversation

@r-devulap

@r-devulap r-devulap commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

Intel open sourced and shared the AVX-512 FP16 high-accuracy (HA) functions. Adding them here to the repo.

Functions added: acos, acosh, asin, asinh, atan, atan2, atanh, cbrt, cos, cosh, exp, exp2, exp10, expm1, log, log2, log10, log1p, pow, sin, sinh, tan, tanh.

It looks to me that these use FP32 internally to meet accuracy requirements. Current strategy in NumPy is to do that exactly: we convert to FP32, use the FP32 SVML functions and recovert back to FP16 which can all be done using the base AVX512 SKX ISA using vcvtph2ps (which doesn't need AVX512_FP16).

Functions added: acos, acosh, asin, asinh, atan, atan2, atanh, cbrt,
cos, cosh, exp, exp2, exp10, expm1, log, log2, log10, log1p, pow,
sin, sinh, tan, tanh
Add .section .note.GNU-stack,"",@progbits to all 23 FP16 HA
assembly files.
- Add endbr64 at every function entry point for IBT (Indirect Branch
  Tracking) support
- Add .note.gnu.property section declaring IBT (0xc0000002) and
  shadow stack (0x00000003) compatibility flags
@r-devulap r-devulap changed the title Adding new shared SVML Float16 HA imlementation Adding newly shared SVML Float16 HA imlementation Aug 21, 2026
@r-devulap
r-devulap requested a review from seberg August 21, 2026 05:13
@r-devulap

Copy link
Copy Markdown
Member Author

@seberg I will go ahead and merge this. I am curious if they provide any kind of perf benefits. Will experiment with it and pull it into NumPy if it makes sense.

@r-devulap
r-devulap merged commit 9a43e74 into numpy:main Sep 11, 2026
@seberg

seberg commented Sep 11, 2026

Copy link
Copy Markdown
Member

Yes, thanks. Sorry it seems all fine to port. (I feel a bit we have to still figure out how much fp16 SIMD we want in NumPy, but if it's an obvious gain. We had prevoiusly issue with fp16 SIMD accuracy, because users expected float32, or close to it, accuracy.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants